package com.sali.b_design_pattern.g_singleton_pattern.lesson_destroy_singleton.a_reflect.unsafe;

/**
 * @description:
 * @date: 2023/3/19 12:28.
 * @version: 1.0
 */
public class HungrySingleton2 {

    /**
     * description: 饿汉单例对象：告诉我们在这个类加载时，即会在内存空间中申请一个地址出来存放实例
     **/
    private static HungrySingleton2 instance = new HungrySingleton2();

    /**
     * description: 构造函数私有化
     **/
    private HungrySingleton2() {
    }

    /**
     * description: 返回单例对象
     **/
    public static HungrySingleton2 getInstance() {
        return instance;
    }

}
